<?php

namespace drivers;

class logs extends \Monolog\Logger {

    function __construct($name)
    {
        #创建日志频道
        parent::__construct($name);
    }

    function inError()
    {
        $Stream = new \Monolog\Handler\StreamHandler(__LOGS__.'error/'.date('Y-m-d').'.log',self::WARNING);
        $this->pushHandler($Stream);
    }

    function inData($name)
    {
        $Stream = new \Monolog\Handler\StreamHandler(__LOGS__.'data/'.$name.'.log',self::WARNING);
        $this->pushHandler($Stream);
    }
}